<?xml version="1.0" encoding="ascii"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>ESim</title>
  <link rel="stylesheet" href="epydoc.css" type="text/css" />
  <script type="text/javascript" src="epydoc.js"></script>
</head>

<body bgcolor="white" text="black" link="blue" vlink="#204080"
      alink="#204080">
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="https://code.google.com/p/epyat">epyat</a></th>
          </tr></table></th>
  </tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="100%">
      <span class="breadcrumbs">
        Module&nbsp;ESim
      </span>
    </td>
    <td>
      <table cellpadding="0" cellspacing="0">
        <!-- hide/show private -->
        <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink"
    onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr>
        <tr><td align="right"><span class="options"
            >[<a href="frames.html" target="_top">frames</a
            >]&nbsp;|&nbsp;<a href="ESim-module.html"
            target="_top">no&nbsp;frames</a>]</span></td></tr>
      </table>
    </td>
  </tr>
</table>
<!-- ==================== MODULE DESCRIPTION ==================== -->
<h1 class="epydoc">Module ESim</h1><p class="nomargin-top"><span class="codelink"><a href="ESim-pysrc.html">source&nbsp;code</a></span></p>
<p>The ESim module is used to query the SIM status and to set or change 
  the SIM's PIN.</p>
  <p>All functions in this module may throw an EInterface.CommandError or 
  an EInterface.TimeoutException, if a command used by this function 
  couldn't be executed properly. However, this should only happen in these 
  functions, where the exception is documented.</p>

<hr />
<div class="fields">      <p><strong>Author:</strong>
        Patrick Strobel
      </p>
      <p><strong>Version:</strong>
        $Revision: 14 $
      </p>
</div><!-- ==================== FUNCTIONS ==================== -->
<a name="section-Functions"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Functions</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Functions"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="ESim-module.html#enterPin" class="summary-sig-name">enterPin</a>(<span class="summary-sig-arg">pin</span>,
        <span class="summary-sig-arg">newPin</span>=<span class="summary-sig-default">None</span>)</span><br />
      Sends the SIM's PIN or PUK to the module, if a PIN or PUK has to be 
      entered.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="ESim-pysrc.html#enterPin">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">string</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="ESim-module.html#getStatus" class="summary-sig-name">getStatus</a>()</span><br />
      Gets the SIM's status.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="ESim-pysrc.html#getStatus">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">boolean</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="ESim-module.html#isInserted" class="summary-sig-name">isInserted</a>()</span><br />
      Checks if the SIM is inserted into the module.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="ESim-pysrc.html#isInserted">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">boolean</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="ESim-module.html#isReady" class="summary-sig-name">isReady</a>()</span><br />
      Checks if the SIM is ready.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="ESim-pysrc.html#isReady">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
      <table width="100%" cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td><span class="summary-sig"><a href="ESim-module.html#waitTillReady" class="summary-sig-name">waitTillReady</a>(<span class="summary-sig-arg">timeout</span>=<span class="summary-sig-default">10</span>)</span><br />
      Waits till the SIM becomes ready.</td>
          <td align="right" valign="top">
            <span class="codelink"><a href="ESim-pysrc.html#waitTillReady">source&nbsp;code</a></span>
            
          </td>
        </tr>
      </table>
      
    </td>
  </tr>
</table>
<!-- ==================== VARIABLES ==================== -->
<a name="section-Variables"></a>
<table class="summary" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Variables</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-Variables"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
<tr>
    <td width="15%" align="right" valign="top" class="summary">
      <span class="summary-type">&nbsp;</span>
    </td><td class="summary">
        <a name="__package__"></a><span class="summary-name">__package__</span> = <code title="None">None</code>
    </td>
  </tr>
</table>
<!-- ==================== FUNCTION DETAILS ==================== -->
<a name="section-FunctionDetails"></a>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr bgcolor="#70b0f0" class="table-header">
  <td colspan="2" class="table-header">
    <table border="0" cellpadding="0" cellspacing="0" width="100%">
      <tr valign="top">
        <td align="left"><span class="table-header">Function Details</span></td>
        <td align="right" valign="top"
         ><span class="options">[<a href="#section-FunctionDetails"
         class="privatelink" onclick="toggle_private();"
         >hide private</a>]</span></td>
      </tr>
    </table>
  </td>
</tr>
</table>
<a name="enterPin"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">enterPin</span>(<span class="sig-arg">pin</span>,
        <span class="sig-arg">newPin</span>=<span class="sig-default">None</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="ESim-pysrc.html#enterPin">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Sends the SIM's PIN or PUK to the module, if a PIN or PUK has to be 
  entered.</p>
  <p>Please keep in mind that you will have to enter the PUK if a invalid 
  PIN has been entered for three times. Also, the SIM might be locked if a 
  invalid PUK is entered to often.</p>
  <p>Use getStatus() to see if a PIN is required.</p>
  <p>Command: AT+CPIN</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>pin</code></strong> (int) - The PIN that will be send to the device. This can be either a PIN
          (4 digits) or a PUK, if this is requested (typically if a invalid
          PIN has been entered three times).</li>
        <li><strong class="pname"><code>newPin</code></strong> (int) - Sets the PIN to a new value. This is required if the first 
          parameter is a PUK and optional if the first parameter is a 
          4-digit-PIN.</li>
    </ul></dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="EInterface.CommandError-class.html">EInterface.CommandError</a></strong></code> - Thrown, if the PIN/PUK couldn't be set because no SIM is inserted, 
        the PIN/PUK is invalid or has been entered to often.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="getStatus"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">getStatus</span>()</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="ESim-pysrc.html#getStatus">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Gets the SIM's status.</p>
  <p>Command: AT+CPIN</p>
  <dl class="fields">
    <dt>Returns: string</dt>
        <dd>The status. On of the strings READY, SIM PIN, SIM PUK, PH-SIM 
          PIN, PH-FSIM PIN, PH-FSIM PUK, SIM PIN2, SIM PUK2, PH-NET PIN, 
          PH-NET PUK, PH-NETSUB PIN, PH-NETSUB PUK, PH-SP PIN, PH-SP PUK, 
          PH-CORP PIN, PH-CORP PUK or PH-MCL PIN. See the AT Commands 
          Reference Guide for detailed information.</dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="EInterface.CommandError-class.html">EInterface.CommandError</a></strong></code> - Thrown, if the status couldn't be read because no SIM is inserted.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<a name="isInserted"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">isInserted</span>()</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="ESim-pysrc.html#isInserted">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Checks if the SIM is inserted into the module.</p>
  <p>Command: AT#QSS</p>
  <dl class="fields">
    <dt>Returns: boolean</dt>
        <dd>True, if SIM is inserted.</dd>
  </dl>
</td></tr></table>
</div>
<a name="isReady"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">isReady</span>()</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="ESim-pysrc.html#isReady">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Checks if the SIM is ready.</p>
  <p>Shortly after the module has booted, the module copies the entries of 
  the SIM's phone-book into the RAM. While this data is copied, the SIM 
  cannot be accessed.</p>
  <p>Command: AT+CPBS</p>
  <dl class="fields">
    <dt>Returns: boolean</dt>
        <dd>True, if the SIM is ready. That is, all data has been copied into
          the RAM.</dd>
  </dl>
</td></tr></table>
</div>
<a name="waitTillReady"></a>
<div>
<table class="details" border="1" cellpadding="3"
       cellspacing="0" width="100%" bgcolor="white">
<tr><td>
  <table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr valign="top"><td>
  <h3 class="epydoc"><span class="sig"><span class="sig-name">waitTillReady</span>(<span class="sig-arg">timeout</span>=<span class="sig-default">10</span>)</span>
  </h3>
  </td><td align="right" valign="top"
    ><span class="codelink"><a href="ESim-pysrc.html#waitTillReady">source&nbsp;code</a></span>&nbsp;
    </td>
  </tr></table>
  
  <p>Waits till the SIM becomes ready.</p>
  <p>This function will wait until all phone-book entries have been copied 
  into the RAM (see isReady()).</p>
  <p>Command: AT+CPBS</p>
  <dl class="fields">
    <dt>Parameters:</dt>
    <dd><ul class="nomargin-top">
        <li><strong class="pname"><code>maxTimeout</code></strong> - Maxiumum time in seconds to wait for the SIM to become ready.</li>
    </ul></dd>
    <dt>Raises:</dt>
    <dd><ul class="nomargin-top">
        <li><code><strong class='fraise'><a href="EInterface.TimeoutException-class.html">EInterface.TimeoutException</a></strong></code> - Thrown, if SIM is not ready after maxTimeout seconds.</li>
    </ul></dd>
  </dl>
</td></tr></table>
</div>
<br />
<!-- ==================== NAVIGATION BAR ==================== -->
<table class="navbar" border="0" width="100%" cellpadding="0"
       bgcolor="#a0c0ff" cellspacing="0">
  <tr valign="middle">

  <!-- Tree link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Index link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Help link -->
      <th>&nbsp;&nbsp;&nbsp;<a
        href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th>

  <!-- Project homepage -->
      <th class="navbar" align="right" width="100%">
        <table border="0" cellpadding="0" cellspacing="0">
          <tr><th class="navbar" align="center"
            ><a class="navbar" target="_top" href="https://code.google.com/p/epyat">epyat</a></th>
          </tr></table></th>
  </tr>
</table>
<table border="0" cellpadding="0" cellspacing="0" width="100%%">
  <tr>
    <td align="left" class="footer">
    Generated by Epydoc 3.0.1 on Mon Oct 01 17:02:04 2012
    </td>
    <td align="right" class="footer">
      <a target="mainFrame" href="http://epydoc.sourceforge.net"
        >http://epydoc.sourceforge.net</a>
    </td>
  </tr>
</table>

<script type="text/javascript">
  <!--
  // Private objects are initially displayed (because if
  // javascript is turned off then we want them to be
  // visible); but by default, we want to hide them.  So hide
  // them unless we have a cookie that says to show them.
  checkCookie();
  // -->
</script>
</body>
</html>
